from socket import socket

client = socket()
client.connect(('10.7.156.1', 8082))
pic_length = int(client.recv(1024).decode())
sum_length = 0  # 保存接收到的图片总长度

# while 1:
# 1.
# re_data = client.recv(1024)
# length = len(re_data)
# sum_length += length
# with open('client/test.jpeg', 'ab') as f:
#     f.write(re_data)
# if sum_length == pic_length:
#     break
